package com.collabscm.waf.vo;

import com.collabscm.waf.solution.validation.BeanValidationUtils;

/**
 * 查询条件
 *
 * @author Zeng Raoxing
 */
public abstract class QueryCondition extends ValueObject {
	private static final long serialVersionUID = 1L;
	/**
	 * 排序参数
	 */
	private String orderBy;
	/**
	 * 是否升序
	 */
	private boolean isAscending;
	/**
	 * 页号
	 */
	private Integer pageNumber;
	/**
	 * 每页限制大小
	 */
	private Integer pageSize;
	
	public String getOrderBy() {
		return orderBy;
	}
	public void setOrderBy(String orderBy) {
		this.orderBy = orderBy;
	}
	public boolean isAscending() {
		return isAscending;
	}
	public void setAscending(boolean isAscending) {
		this.isAscending = isAscending;
	}
	public Integer getPageNumber() {
		return pageNumber;
	}
	public void setPageNumber(Integer pageNumber) {
		this.pageNumber = pageNumber;
	}
	public Integer getPageSize() {
		return pageSize;
	}
	public void setPageSize(Integer pageSize) {
		this.pageSize = pageSize;
	}
	/**
	 * 验证查询数据的逻辑是否符合要求，默认情况仅调用BeanValidation进行验证。
	 * 注意：如果验证失败，请抛出BeanValidationFailure，将提示信息都包含在这个Failure中。
	 * @throws BeanValidationFailure
	 */
	public void validate() {
		BeanValidationUtils.validate(this);
	}
}
